<script type='text/javascript'>

    $(document).ready(function(){

        $("#btn_pilih_NOP").click(function(){
            $("#dialog-objek").dialog('open');
        });

    });


    //function PilihNop(no_op){
    //$("#no_op").val(no_op);
    //$("#dialog-objek").dialog('close');
    //}

    function PilihNop(no_op){
        $("#no_op").val(no_op);
        $("#nama_pmk").val(nm_pmk)
						
        $("#alamat_pmk").val(alamat_pmk)
        $("#dialog-objek").dialog('close');						
        //coba
	
    }



</script>



<?php
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
    'id' => 'horizontalForm',
    'type' => 'horizontal',
    'enableAjaxValidation' => false,
        ));
?>
<fieldset>

    <?php echo $form->errorSummary($model); ?>

    <div class="portlet-decoration">A. Data SSPD </div>

    <br>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik"><b>Nomor SSPD</b></label>
        <div class="controls">
            <?php echo $form->textField($model, 'no_reg', array('class' => 'span2', 'maxlength' => 25)); ?>

        </div>
    </div>

        <div class="control-group ">
        <label class="control-label" for="Nama Pemilik"><b>Nomor Terakhir</b></label>
        <div class="controls">
            <?php echo $form->textField($model, 'no_form', array('class' => 'span2', 'maxlength' => 25,'readonly'=>true, 'value'=>'0003')); ?>

        </div>
    </div>

    
    <div class="portlet-decoration">B. Data Pemilik</div>
    <br>
    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik"><b>Nomor Objek Pajak </b></label>
        <div class="controls">
            <input type = "text" name="no_op[]" id="no_op" class="span1">
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            -
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            -

            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            -
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            -
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            -
            <input type = "text" name="no_op[]" class="span1" >

        </div>
    </div>


    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">Letak Bangunan </label>
        <div class="controls">
            <?php echo $form->textField($modelObjekPajak, 'lokasi_op', array('class' => 'span5', 'maxlength' => 25)); ?>
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">Kecamatan </label>
        <div class="controls">
            <?php echo $form->textField($modelObjekPajak, 'kec_pmk', array('class' => 'span5',  'maxlength' => 50)); ?>
        </div>
    </div>


    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">Kelurahan/Desa </label>
        <div class="controls">
            <?php echo $form->textField($modelObjekPajak, 'kel_pmk', array('class' => 'span5', 'maxlength' => 50)); ?>
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik"> RT </label>
        <div class="controls">
            <?php echo $form->textField($modelObjekPajak, 'rt_op', array('class' => 'span1', 'maxlength' => 3)); ?>
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik"> RW </label>
        <div class="controls">
            <?php echo $form->textField($modelObjekPajak, 'rw_op', array('class' => 'span1', 'maxlength' => 3)); ?>
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">Kabupaten</label>
        <div class="controls">
            <?php echo $form->textField($modelObjekPajak, 'kab_pmk', array('class' => 'span5', 'maxlength' => 50)); ?>
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">Nama Pemilik</label>
        <div class="controls">
            <?php echo $form->textField($modelObjekPajak, 'nama_pmk', array('class' => 'span5',  'maxlength' => 50)); ?>
        </div>
    </div>
    
    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">Alamat Pemilik</label>
        <div class="controls">
            <?php echo $form->textField($modelObjekPajak, 'alamat_pmk', array('class' => 'span5', 'maxlength' => 50)); ?>
        </div>
    </div>
    
    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">Nomor KTP[NIK]</label>
        <div class="controls">
            <?php echo $form->textField($modelObjekPajak, 'nik_pmk', array('class' => 'span5', 'maxlength' => 50)); ?>
        </div>
    </div>

        <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">Jenis Transaksi</label>
        <div class="controls">
         <?php echo $form->DropDownList($modelDokTerima, 'kode_jns', CHtml::listData($modelJenisPrh, 'kode_jns', 'jenis_prh'  ), array('class' => 'span3', 'prompt' => ' ')); ?>
        </div>
    </div>
    
    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">Perihal</label>
        <div class="controls">
             <?php echo $form->DropDownList($modelDokTerima, 'kode_jsd', CHtml::listData($modelJenisDok, 'kode_jsd', 'jenis_dok'  ), array('class' => 'span3', 'prompt' => ' ')); ?>
        </div>
    </div>
    

    
    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">Tahun</label>
        <div class="controls">
            <?php echo $form->textField($modelDokTerima, 'tahun', array('class' => 'span2','value'=>date('Y'), 'maxlength' => 10)); ?>
        </div>
    </div>

    <div class="portlet-decoration"><b>C. Data Pembeli</b></div>
    <br>
    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">NIK [KTP] </label>
        <div class="controls">

            <input type = "text" name="no_op[]" id="no_op" class="span1" readonly>
            <input type = "text" name="no_op[]" class="span1" readonly>
            <input type = "text" name="no_op[]" class="span1" readonly>
            <input type = "text" name="no_op[]" class="span1" readonly>
            <input type = "text" name="no_op[]" class="span1" readonly>
            -
            <input type = "text" name="no_op[]" class="span1" readonly>
            <input type = "text" name="no_op[]" class="span1" readonly>
            -

            <input type = "text" name="no_op[]" class="span1" readonly>
            <input type = "text" name="no_op[]" class="span1" readonly>
            <input type = "text" name="no_op[]" class="span1" readonly>
            <input type = "text" name="no_op[]" class="span1" readonly>
            <input type = "text" name="no_op[]" class="span1" readonly>
            <input type = "text" name="no_op[]" class="span1" readonly>
            -
            <input type = "text" name="no_op[]" class="span1" readonly>
            <input type = "text" name="no_op[]" class="span1" readonly>
            <input type = "text" name="no_op[]" class="span1" readonly>
            <input type = "text" name="no_op[]" class="span1" readonly>


        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">NAMA WAJIB PAJAK</label>
        <div class="controls">
            <?php echo $form->textField($modelWajibPajak, 'nama_wp', array('class' => 'span5', 'maxlength' => 25)); ?>
        </div>
    </div>


    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">ALAMAT WAJIB PAJAK</label>
        <div class="controls">
            <?php echo $form->textField($modelWajibPajak, 'alamat_wp', array('class' => 'span5', 'maxlength' => 50)); ?>
        </div>
    </div>


    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">Kecamatan </label>
        <div class="controls">
            <?php echo $form->textField($modelWajibPajak, 'nama_kec', array('class' => 'span5',  'maxlength' => 50)); ?>
        </div>
    </div>


    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">Kelurahan/Desa </label>
        <div class="controls">
            <?php echo $form->textField($modelWajibPajak, 'nama_kel', array('class' => 'span5', 'maxlength' => 50)); ?>
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik"> RT </label>
        <div class="controls">
            <?php echo $form->textField($modelWajibPajak, 'rt_wp', array('class' => 'span1', 'maxlength' => 3)); ?>
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik"> RW </label>
        <div class="controls">
            <?php echo $form->textField($modelWajibPajak, 'rw_wp', array('class' => 'span1', 'maxlength' => 3)); ?>
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik"> Kabupaten </label>
        <div class="controls">
            <?php echo $form->textField($modelWajibPajak, 'kab_wp', array('class' => 'span2','maxlength' => 3,'value'=>'Gianyar')); ?>
        </div>
    </div>

    <div class="portlet-decoration">D. Data PPAT</div>
    <br>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">No ID PPAT</label>
        <div class="controls">
            <input type = "text" name="no_op[]" id="no_op" class="span1" maxlength="1">
            <input type = "text" name="no_op[]" id="no_op" class="span1" maxlength="1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            -
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
        
                   <?php
            $this->widget('bootstrap.widgets.TbButton', array(
                'id' => 'btn_pilih_NOP',
                'type' => 'primary',
                'label' => 'F1',
            ));
            ?>
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">Nama PPAT</label>
        <div class="controls">
            <?php echo $form->textField($modelPpat, 'nama_ppat', array('class' => 'span2','readonly'=>true, 'maxlength' => 35)); ?>
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">Tanggal Masuk</label>
        <div class="controls">
            <?php echo $form->textField($modelDokTerima, 'tgl_masuk', array('class' => 'span2', 'maxlength' => 3)); ?>
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">Tanggal Selesai</label>
        <div class="controls">
            <?php echo $form->textField($modelDokTerima, 'tgl_selesai', array('class' => 'span2', 'maxlength' => 3)); ?>
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">Keterangan</label>
        <div class="controls">
            <?php echo $form->textArea($modelDokTerima, 'ket', array('class' => 'span6', 'maxlength' => 300)); ?>
        </div>

    </div>

    
     <div class="form-actions">
        <?php
        $this->widget('bootstrap.widgets.TbButton', array(
            'buttonType' => 'submit',
            'type' => 'primary',
            'label' => $model->isNewRecord ? 'Simpan' : 'Save',
        ));
        ?>
        <?php
        $this->widget('bootstrap.widgets.TbButton', array(
            'buttonType' => 'submit',
            'type' => 'primary',
            'label' => $model->isNewRecord ? 'Batal' : 'Reset',
        ));
        ?>
        <?php
        $this->widget('bootstrap.widgets.TbButton', array(
            'buttonType' => 'submit',
            'type' => 'primary',
            'label' => $model->isNewRecord ? 'Cari' : 'cari',
        ));
        ?>
    </div>

    <?php $this->endWidget(); ?>


    <?php
    $this->beginWidget('zii.widgets.jui.CJuiDialog', array(
        'id' => 'dialog-objek',
        'theme' => 'sunny',
        'themeUrl' => Yii::app()->request->baseUrl . '/css/themes',
        'options' => array(
            'title' => 'Data Objek',
            'width' => 600,
            'min-height' => 400,
            'autoOpen' => false,
            'buttons' => array(
                'Ok' => 'js:function(){$(this).dialog("close")}',),
        ),
    ));
    ?>


    <?php
    $this->widget('bootstrap.widgets.TbGridView', array(
        'id' => 'ObjekPajak',
        'dataProvider' => $modelObjekPajak->search(),
        'filter' => $modelObjekPajak,
        'columns' => array(
            array(
                'name' => 'no_op',
                'value' => '$data->no_op',
            ),
            array(
                'name' => 'nama_pmk',
                'value' => '$data->nama_pmk'
            ),
            array(
                'value' => 'CHtml::submitButton("Pilih",array("no_op"=>$data->no_op,"nama_pmk"=>$data->nama_pmk,"onClick"=>"PilihNop($(this).attr(\'no_op\'))"))',
                'type' => 'raw',
            ),
        ),
    ));
    ?>


    <?php
    $this->endWidget('zii.widgets.jui.CJuiDialog');
    ?>

    <?php
    $this->beginWidget('zii.widgets.jui.CJuiDialog', array(
        'id' => 'dialog-alert',
        'theme' => 'sunny',
        'themeUrl' => Yii::app()->request->baseUrl . '/css/themes',
        'options' => array(
            'title' => 'Data Objek',
            'width' => 600,
            'min-height' => 400,
            'autoOpen' => false,
            'buttons' => array(
                'Ok' => 'js:function(){$(this).dialog("close")}',),
        ),
    ));
    ?>

    <div id='txtAlert'></div>

    <?php
    $this->endWidget('zii.widgets.jui.CJuiDialog');
    ?>
</fieldset>